package com.uwang.library.dao.impl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.uwang.library.dao.MemberAddDao;
import com.uwang.library.model.BtnModel;
import com.uwang.library.util.DruidUtil;

public class MemberAddDaoImpl implements MemberAddDao{

	@Override
	public void add(String userName, String sex, String userPhone, String email, String enclosure, String address,
			String beizhu) {
		PreparedStatement preparedStatement;
		ResultSet resultSet = null;
		try {
			Connection connection= DruidUtil.getConnection();
			String sql = "insert into member (user_name,sex,user_phone,email,enclosure,address,beizhu,create_time) values(?,?,?,?,?,?,?,NOW())";
			preparedStatement = connection.prepareStatement(sql);
			preparedStatement.setString(1, userName);
			preparedStatement.setString(2, sex);
			preparedStatement.setString(3, userPhone);
			preparedStatement.setString(4, email);
			preparedStatement.setString(5, enclosure);
			preparedStatement.setString(6, address);
			preparedStatement.setString(7, beizhu);
			preparedStatement.executeUpdate();
			}catch(SQLException e) {
				e.printStackTrace();
			}
		
	}

}
